using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace TXLooker.WorkItemExtention.UI.QueryManager
{
    public partial class SaveQueryErrorsForm : Form
    {
        private SaveQueryErrorsForm()
        {
            InitializeComponent();
        }

        public SaveQueryErrorsForm(List<SaveQueryErrors> errors): this()
        {
            foreach (SaveQueryErrors error in errors)
                this.m_dataGridView.Rows.Add(error.QueryName,error.Message);
        }

        private void OnSizeChanged(object sender, EventArgs e)
        {
            this.m_dataGridView.Columns.GetLastColumn(DataGridViewElementStates.None,DataGridViewElementStates.None).Width =
                this.m_dataGridView.Width - this.m_dataGridView.Columns.GetFirstColumn(DataGridViewElementStates.None).Width -
                this.m_dataGridView.RowHeadersWidth;
        }
    }
}